package com.dmm.user.controller;


import com.dmm.result.Result;
import com.dmm.user.entity.Emp;
import com.dmm.user.service.EmpService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dmm
 * @since 2022-10-14
 */
@RestController
@RequestMapping("/user/emp")
public class EmpController {

    @Resource
    EmpService empService;

    @GetMapping("FindAll")
    @ApiOperation("查询所有数据")
    public Result FindAll(){

        List<Emp> list=empService.Findall();

        return Result.success(list);
    }

    @PostMapping("/sava")
    @ApiOperation("修改")
    public Result sava(@RequestBody Emp emp){

        empService.savabyid(emp);

        return Result.success(null);
    }

}

